import React from 'react';
import { Button as AntdButton } from 'antd-mobile-v2';

interface Props {
  btntype?: string;
  [propName: string]: any;
}

const Button: React.FC<Props> = (props) => {

  const getButton = (): React.ReactElement => {
    switch (props.btntype) {
      case 'ensure':
        return <AntdButton size="small" style={{ border: '1px solid #666666', color: '#222222', fontWeight: 'bold' }} {...props}>{props.children}</AntdButton>;
      case 'cancel':
        return <AntdButton size="small" {...props}>{props.children}</AntdButton>;
      default:
        return <AntdButton {...props}>{props.children}</AntdButton>;
    }
  };

  return (
    getButton()
  );
};

export default Button;